package cn.itcast.jsoup;

import org.apache.commons.io.FileUtils;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

import java.io.File;
import java.io.IOException;

// 解析文件
public class Jsoup_ResolveFile {
    public static void main(String[] args) {
        String path = "xxx";
        try {
            Document document = Jsoup.parse(new File(path),"UTF-8");
            String title = document.getElementsByTag("title").first().text();
            System.out.println(title);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
